package com.example.demo.mapper;

import com.example.demo.pojo.Cart;
import com.example.demo.pojo.Dto.CartDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartMapper {
    public int insertToCart(@Param("userid")int userid, @Param("goodsid")int goodsid, @Param("price")double price,
                            @Param("nums")int nums);

    public List<CartDto> selectAllGoods(@Param("userid")int userid);
    //查询是否有相同数据
    public Cart selectGoods(@Param("userid")int userid, @Param("goodsid")int goodsid);
    //更新数据
    public int updateGoods(@Param("id")int id,@Param("nums")int nums);
    //删除数据
    public int delGoods(int id);

    public List<CartDto> queryIds(int[] ids);
}
